package javax.per.toolkit.mail;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 * 
 * @author yl34569
 *
 */
public class MailSendInfo{
	
	private String mailServerHost;
	private String mailServerPort="25";
	private String fromAddress;
	private List<String> toAddress=new ArrayList<String>();
	private List<String> ccAddress=new ArrayList<String>();
	private String userName;
	private String password;
	//是否需要身份验证
	private boolean validate=false;
	private String subject;
	private String content;
	private List<String> attachFileNames=new ArrayList<String>();
	public Properties getProperties(){
		Properties p=new Properties();
		p.put("mail.smtp.host", this.mailServerHost);    
	    p.put("mail.smtp.port", this.mailServerPort);    
	    p.put("mail.smtp.auth", validate ? "true" : "false");    
	    return p;    
	}

	public String getMailServerHost() {
		return mailServerHost;
	}

	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}

	public String getMailServerPort() {
		return mailServerPort;
	}


	public String getFromAddress() {
		return fromAddress;
	}

	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public Object[] getToAddress() {
		return toAddress.toArray();
	}

	public void addToAddress(String toAddress) {
		this.toAddress.add(toAddress);
	}
	
	public Object[] getCcAddress() {
		return ccAddress.toArray();
	}

	public void addCcAddress(String toAddress) {
		this.ccAddress.add(toAddress);
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(boolean validate) {
		this.validate = validate;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Object[] getAttachFileNames() {
		return attachFileNames.toArray();
	}

	public void addAttachFileNames(String attachFileNames) {
		this.attachFileNames.add(attachFileNames);
	}
}

